@extends('personal.index')
@section('title','申请退换货')
@section('content')

<!-- 面包屑 -->
<div class="breadcrumbs">
    <div class="container">
        <a href="#" data-stat-id="b0bcd814768c68cc" onclick="">首页</a><span class="sep">&gt;</span><span>商品评价</span>    
    </div>
</div>

	@if (session('success'))
        <script type="text/javascript">
              alert('申请成功');
            </script>
      @endif
      @if (session('error'))
        <script type="text/javascript">
              alert('申请错误');
            </script>
      @endif

<div class="page-main user-main">
    <div class="container">
        <div class="row">
            <div class="span4">
                <div class="uc-box uc-sub-box">
                    <div class="uc-nav-box">
                        <div class="box-hd">
                            <h3 class="title">订单中心</h3>
                        </div>
                        <div class="box-bd">
                            <ul class="uc-nav-list">
                                <li><a href="#">我的订单</a></li>
                                
                                
                                <li><a href="{{url('/personal/comments')}}" >评价晒单</a></li>
                                
                                
                            </ul>
                        </div>
                    </div>
                    <div class="uc-nav-box">
                        <div class="box-hd">
                            <h3 class="title">个人中心</h3>
                        </div>
                        <div class="box-bd">
                            <ul class="uc-nav-list">
                                <li><a href="#">我的个人中心</a></li>
                                <li><a href="#">现金账户</a></li>
                                
                                
                                <li><a href="#">喜欢的商品</a></li>
                                
                                <li><a href="#">收货地址</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="uc-nav-box">
                        <div class="box-hd">
                            <h3 class="title">售后服务</h3>
                        </div>
                        <div class="box-bd">
                            <ul class="uc-nav-list">
                                <li class="active"><a href="{{url('/personal/replace')}}">退换货服务</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    
                </div>
            </div>

            
			<div class="span16">
			    <div class="uc-box uc-main-box">
			        <div class="uc-content-box">
			            <div class="box-hd">
			                <h1 class="title">退换货商品</h1>
			                <div class="more clearfix">
			                    <ul class="filter-list J_addrType">
			                        <li class="first active"><a href="#">申请换货的商品</a></li>
									<!-- 被选中时,添加class='active' -->
			                        <li class="second"><a href="#">申请退货的商品</a></li>

			                    </ul>
			                </div>
			            </div>
			            <div class="box-bd">
			                <div class="xm-goods-list-wrap">

			                    

								<!-- 申请换货的商品 -->
			                    <ul class="xm-goods-list clearfix dpj" style='display:block'>
			                    	
									@foreach($date as $k => $v)
			                        <li class="xm-goods-item" style='@if($v->status == 3 && $v->statuss == 0)
																		display:block;
																	@else
																		display:none;
																	@endif
			                        '>
			                            <div class="figure figure-img">
			                            	<a target="_blank" href="#">
			                            		<!-- 商品的图片 -->
			                            		<img src="{{$v->image}}">
			                            	</a>
			                            </div>
			                            <h3 class="title"><a href="#">{{$v->proname}}</a></h3>
			                                <p class="price">订单号:{{$v->order_code}}</p>
			                                <p class="price">下单时间:{{$v->order_time}}</p>
			                            <div class="actions">
			                            
			                            	<a href="{{url('/personal/des',[$v->gid])}}" class="btn btn-primary btn-small">查看订单详情</a>
			                            
			                        	</div>
			                        </li>
									@endforeach
									
			                    </ul>

			                    <!-- 点击哪个,哪个的ul显示且另一个的ul添加display:none属性 -->
			                	<!-- 申请退货的商品 -->
			                    <ul class="xm-goods-list clearfix ypj" style='display:none'>
									@foreach($date as $k => $v)
			                        <li class="xm-goods-item" style='@if($v->status == 4 && $v->statuss == 1)
																		display:block;
																	@else
																		display:none;
																	@endif
			                        '>
			                            <div class="figure figure-img">
			                            	<a target="_blank" href="#">

			                            	<!-- 商品的图片 -->
			                            	<img src="{{$v->image}}">

			                            	</a>
			                            </div>
			                            <h3 class="title"><a href="#">{{$v->proname}}</a></h3>
			                            	<p class="price">订单号:{{$v->order_code}}</p>
			                                <p class="price">下单时间:{{$v->order_time}}</p>
			                            <div class="actions">
			                            	<a href="{{url('/personal/des',[$v->gid])}}" class="btn btn-primary btn-small">查看商品详情</a>
			                        	</div>
			                        </li>
									@endforeach
			                    </ul>

			                </div>
			            </div>
			        </div>
			        <script type="text/javascript">
			        // alert({{$maxHH}});
						var one = $('.filter-list').children('.first');			
						var two = $('.filter-list').children('.second');
						var dpj = $('.dpj');
						var ypj = $('.ypj');
						one.children('a').html('申请换货的商品( {{$maxHH}} )');
						two.children('a').html('申请退货商品( {{$maxTH}} )');
						one.click(function() {
							one.addClass('active');
							dpj.removeAttr('style');
							ypj.removeAttr('style');
							dpj.attr('style','display:block');
							ypj.attr('style','display:none');							
							two.removeClass('active');
						});
						two.click(function() {
							one.removeClass('active');
							two.addClass('active');
							dpj.removeAttr('style');
							dpj.attr('style','display:none');
							ypj.removeAttr('style');
							ypj.attr('style','display:block');
							one.removeClass('active');
						});

						$('.uc-nav-list').children().click(function() {
							$(this).addClass('active');
							$(this).siblings().removeClass('active');
						});
					</script>
			    </div>
			</div>

        </div>
    </div>
</div>


@endsection